<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.hr.user.domain.User"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>人力资源系统管理系统</title>
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/admin-all.css" />
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/base.css" />
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/HR_SYSTEM/Styles/ui-lightness/jquery-ui-1.8.22.custom.css" />
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/jquery-ui-1.8.22.custom.min.js"></script>
    <script type="text/javascript" src="/HR_SYSTEM/Scripts/index.js"></script>
    <script language="JavaScript">
			function startTime()   
			{   
				var today=new Date();//定义日期对象   
				var yyyy = today.getFullYear();//通过日期对象的getFullYear()方法返回年    
				var MM = today.getMonth()+1;//通过日期对象的getMonth()方法返回年    
				var dd = today.getDate();//通过日期对象的getDate()方法返回年     
				var hh=today.getHours();//通过日期对象的getHours方法返回小时   
				var mm=today.getMinutes();//通过日期对象的getMinutes方法返回分钟   
				var ss=today.getSeconds();//通过日期对象的getSeconds方法返回秒   
				// 如果分钟或小时的值小于10，则在其值前加0，比如如果时间是下午3点20分9秒的话，则显示15：20：09   
				MM=checkTime(MM);
				dd=checkTime(dd);
				mm=checkTime(mm);   
				ss=checkTime(ss);    
				var day; //用于保存星期（getDay()方法得到星期编号）
				if(today.getDay()==0)   day   =   "星期日 " 
				if(today.getDay()==1)   day   =   "星期一 " 
				if(today.getDay()==2)   day   =   "星期二 " 
				if(today.getDay()==3)   day   =   "星期三 " 
				if(today.getDay()==4)   day   =   "星期四 " 
				if(today.getDay()==5)   day   =   "星期五 " 
				if(today.getDay()==6)   day   =   "星期六 " 
				document.getElementById('nowDateTimeSpan').innerHTML=yyyy+"-"+MM +"-"+ dd +" " + hh+":"+mm+":"+ss+"&nbsp;&nbsp;&nbsp;" + day;   
				setTimeout('startTime()',1000);//每一秒中重新加载startTime()方法 
			}   
			
			function checkTime(i)   
			{   
				if (i<10){
					i="0" + i;
				}   
				  return i;
			}  
		</script>
</head>
<body onLoad="startTime()">
    <div class="warp">
        <!--头部开始-->
        <div class="top_c">
            <div class="top-menu">
                <ul class="top-menu-nav">
                    <li>人力资源管理系统</li>
                    <li><a href="#">邮件发送<i class="tip-up"></i></a>
                        <ul class="kidc">
                        <li><b class="tip"></b><a target="Conframe" href="<c:url value='/EmailServlet?method=sendEmailPre'/>">发送邮件</a></li>
                    </ul>
                    </li>
                    <li><a href="#">辅助信息<i class="tip-up"></i></a>
                        <ul class="kidc">
                        <li><b class="tip"></b><a target="Conframe" href="<c:url value='/manage/system_info.jsp'/>">系统信息</a></li>
                    </ul>
                    </li>
                </ul>
            </div>
            <div class="top-nav">&nbsp;&nbsp;欢迎您：【${sessionScope.user.username}】&nbsp;&nbsp; || &nbsp;&nbsp;当前时间：<span id="nowDateTimeSpan"></span>||&nbsp;&nbsp;<a target="Conframe" href="/HR_SYSTEM/manage/password_alert.jsp">修改密码</a> || <a href="<c:url value='/UserServlet?method=exit'/>">安全退出</a></div>
        </div>
        <!--头部结束-->
        
        <!--左边菜单开始-->
        <div class="left_c left">
            <h1>人力资源管理操作栏</h1>
            <div class="acc">
            	<c:choose>
            		<c:when test="${empty role}">
            			<a class="one">您还没有分配权限</a>
            		</c:when>
            		<c:otherwise>
            			<c:forEach items="${role.privileges}" var="privilege">
            		<div>
            		<c:if test="${not empty privilege.functions}">
                    <a class="one">${privilege.privilege_name}</a>
                    <c:set var="privilege_id" value="${privilege.role_id}"></c:set>
                    <ul class="kid">
                    	<c:forEach items="${privilege.functions}" var="function">
                    		<c:if test="${privilege_id eq function.role_id}">
                				<li><b class="tip"></b><a target="Conframe" href="<c:url value='${function.function_url}'/>">${function.function_name}</a></li>
                			</c:if>
                    	</c:forEach>
                    </ul>
                    </c:if>
                </div>
            	</c:forEach>
            		</c:otherwise>
            	</c:choose>
            	
                <div id="datepicker"></div>
            </div>
        </div>
        <!--左边菜单结束-->
        
        <!--右边框架开始-->
        <div class="right_c">
            <div class="nav-tip" onclick="javascript:void(0)">&nbsp;</div>
	    </div>
        <div class="Conframe">
            <iframe name="Conframe" id="Conframe" src="<c:url value='/manage/welcom.jsp'/>">
            </iframe>
        </div>
        <!--右边框架结束-->
		
        <!--底部开始-->
        <div class="bottom_c">Copyright &copy;2015 南京大学 云计算与移动大数据 &nbsp;&nbsp;第三组项目</div>
        <!--底部结束-->
    </div>
</body>
</html>
